<?php

declare(strict_types=1);
/**
 * ^2_3^
 * “php bin/hyperf.php vendor:publish hyperf/view-engine”生成的
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\View\Mode;
use Hyperf\View\Engine\BladeEngine;
use Hyperf\ViewEngine\HyperfViewEngine;

return [
    // 使用的渲染引擎
    //'engine' => BladeEngine::class,
    // 不填写则默认为 Task 模式，推荐使用 Task 模式
    //'mode' => Mode::TASK, //需要安装hyperf/task组件
    //
    'engine' => HyperfViewEngine::class,
    'mode' => Mode::SYNC, // hyperf/view-engine组件推荐使用 SYNC 的渲染模式，可以有效减少进程间通信的损耗
    //
    'config' => [
        'view_path' => BASE_PATH . '/storage/view/',
        'cache_path' => BASE_PATH . '/runtime/view/',
        'charset' => 'UTF-8',
    ],

    // Autoload components.
    'autoload' => [
        'classes' => [
            'App\\View\\Component\\',
        ],
        'components' => [
            'components.', // BASE_PATH . '/storage/view/components/'
        ],
    ],

    # Custom components.
    # 自定义组件注册
    'components' => [
        'alert' => \App\View\Component\Alert::class,

        // 'other-alert' => \Other\ViewComponent\Alert::class
    ],

    # View namespaces. (Used for packages)
    # 视图命名空间 (主要用于扩展包中)
    'namespaces' => [
        // 'admin' => BASE_PATH . '/storage/view/vendor/admin',
    ],
];
